<?php /* Smarty version Smarty-3.0.7, created on 2011-04-09 02:36:20
         compiled from "/Users/denisvolkov/Sites/volkovshop/modules/dateofdelivery/beforeCarrier.tpl" */ ?>
<?php /*%%SmartyHeaderCode:696372654d9f71c4e7ce23-43537044%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '78fd139202e5856a8a08a5c882ce1f24eec924be' => 
    array (
      0 => '/Users/denisvolkov/Sites/volkovshop/modules/dateofdelivery/beforeCarrier.tpl',
      1 => 1300195184,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '696372654d9f71c4e7ce23-43537044',
  'function' => 
  array (
  ),
  'has_nocache_code' => false,
)); /*/%%SmartyHeaderCode%%*/?>


<?php if (count($_smarty_tpl->getVariable('datesDelivery')->value)){?>
<script type="text/javascript">

var datesDelivery = new Array();
<?php  $_smarty_tpl->tpl_vars['date'] = new Smarty_Variable;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->getVariable('datesDelivery')->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
if ($_smarty_tpl->_count($_from) > 0){
    foreach ($_from as $_smarty_tpl->tpl_vars['date']->key => $_smarty_tpl->tpl_vars['date']->value){
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['date']->key;
?>
<?php if ($_smarty_tpl->tpl_vars['date']->value){?>
datesDelivery[<?php echo $_smarty_tpl->tpl_vars['k']->value;?>
] = new Array();
datesDelivery[<?php echo $_smarty_tpl->tpl_vars['k']->value;?>
]['minimal'] = "<?php echo $_smarty_tpl->tpl_vars['date']->value[0];?>
";
datesDelivery[<?php echo $_smarty_tpl->tpl_vars['k']->value;?>
]['maximal'] = "<?php echo $_smarty_tpl->tpl_vars['date']->value[1];?>
";
<?php }?>
<?php }} ?>

$(function(){
	if (datesDelivery[<?php echo $_smarty_tpl->getVariable('id_carrier')->value;?>
] != undefined)
	{
		$('span#minimal').html('<b>'+datesDelivery[<?php echo $_smarty_tpl->getVariable('id_carrier')->value;?>
]['minimal']+'</b>');
		$('span#maximal').html('<b>'+datesDelivery[<?php echo $_smarty_tpl->getVariable('id_carrier')->value;?>
]['maximal']+'</b>');
	}
	else
		$('p#dateofdelivery').hide();
	
	$('input[name=id_carrier]').click(function(){
		if (datesDelivery[$(this).val()] != undefined)
		{
			$('p#dateofdelivery').show();
			$('span#minimal').html('<b>'+datesDelivery[$(this).val()]['minimal']+'</b>');
			$('span#maximal').html('<b>'+datesDelivery[$(this).val()]['maximal']+'</b>');
		}
		else
			$('p#dateofdelivery').hide();
	});
});

</script>

<br />
<p id="dateofdelivery"><?php echo smartyTranslate(array('s'=>'Approximate date of delivery with this carrier is between','mod'=>'dateofdelivery'),$_smarty_tpl);?>
 <span id="minimal"></span> <?php echo smartyTranslate(array('s'=>'and','mod'=>'dateofdelivery'),$_smarty_tpl);?>
 <span id="maximal"></span> <sup>*</sup></p>
<p style="font-size:10px;margin:0padding:0;"><sup>*</sup> <?php echo smartyTranslate(array('s'=>'with direct payment methods (e.g: credit card)','mod'=>'dateofdelivery'),$_smarty_tpl);?>
</p>
<?php }?>